

import com.dg.Generator;
import com.dg.JDBCConnectionParam;
import com.dg.annotation.GenerateIBatisConfig;
import com.dg.annotation.GenerateIBatisMapper;
import com.dg.annotation.GenerateIBatisMapperJUnitTest;
import com.dg.annotation.GenerateIBatisMapperXML;
import com.dg.annotation.GenerateIBatisUtil;
import com.dg.annotation.GeneratePojoModel;
import com.dg.annotation.GenerateSQLScriptFile;

public class AAAMain extends Generator {
	private static String templatePath = "/D:/JAVA1/EclipseWorkspace/DG/template/";
	
	public static void main(String[] args) {
		// Inizializzo il generatore
		Generator.init(templatePath);
		Generator.setConnectionParam(new JDBCConnectionParam("com.mysql.jdbc.Driver","jdbc:mysql://localhost:3306/testibatis","root","root"));
		Generator.addProjectOutputPath(GenerateSQLScriptFile.class, "/D:/JAVA1/EclipseWorkspace/DGTest/sqlScript");
		Generator.addProjectOutputPath(GeneratePojoModel.class, "/D:/JAVA1/EclipseWorkspace/DGTest/src/it/dgtest/shared");
		Generator.addProjectOutputPath(GenerateIBatisMapper.class, "/D:/JAVA1/EclipseWorkspace/DGTest/src/it/dgtest/server/ibatis/mapper");
		Generator.addProjectOutputPath(GenerateIBatisMapperXML.class, "/D:/JAVA1/EclipseWorkspace/DGTest/src/it/dgtest/server/ibatis/mapper");
		Generator.addProjectOutputPath(GenerateIBatisUtil.class, "/D:/JAVA1/EclipseWorkspace/DGTest/src/it/dgtest/server/ibatis");
		Generator.addProjectOutputPath(GenerateIBatisConfig.class, "/D:/JAVA1/EclipseWorkspace/DGTest/src");
		Generator.addProjectOutputPath(GenerateIBatisMapperJUnitTest.class, "/D:/JAVA1/EclipseWorkspace/DGTest/test/it/dgtest/test/server/ibatis/mapper");
		Generator.addGlobalVariable("modelPackageName", "it.dgtest.shared");
		Generator.addGlobalVariable("serverMapperPackageName", "it.dgtest.server.ibatis.mapper");
		Generator.addGlobalVariable("serverMapperTestPackageName", "it.dgtest.test.server.ibatis.mapper");
		Generator.addGlobalVariable("serverIBatisPackageName", "it.dgtest.server.ibatis");

		try {
			new ComuneGenerator().generate();
			new ProvinciaGenerator().generate();
			new IBatisConfigGenerator().injectClassesInPackage("it.dgtest.server.ibatis.mapper").generate();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
